package com.chinacoal.microservice.api.model.entity;

import java.io.Serializable;
import java.util.Date;

import javax.validation.constraints.NotBlank;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.chinacoal.microservice.model.common.Entity;
import com.fasterxml.jackson.annotation.JsonFormat;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("ccms_utask_info")
@ApiModel(value="待办实体",description="待办实体")
public class UtaskInfoEntity extends Entity<UtaskInfoEntity> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value ="主键id", example="", required=false)
    @TableId("task_id")
    private String taskId;
    
    @ApiModelProperty(value ="应用编码（取自应用中心）", example="", required=true)
    @NotBlank(message = "应用编码不能为空: sysCode")
    @TableField("sys_code")
    private String sysCode;
    
    @ApiModelProperty(value ="推送时间", example="yyyy-MM-dd", required=true)
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",locale = "zh" , timezone="GMT+8")
    @TableField("send_time")
    private Date sendTime;
    
    @ApiModelProperty(value ="处理时间", example="", required=false)
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",locale = "zh" , timezone="GMT+8")
    @TableField("handle_time")
    private Date handleTime;

    @ApiModelProperty(value ="待办Id", example="来源其他系统", required=true)
    @NotBlank(message = "待办Id不能为空: sysTaskId")
    @TableField("sys_task_id")
    private String sysTaskId;

    @ApiModelProperty(value ="待办标题", example="", required=true)
    @NotBlank(message = "待办标题不能为空: taskName")
    @TableField("task_name")
    private String taskName;

    @ApiModelProperty(value ="上一环节用户名", example="", required=false)
    @TableField("send_user_name")
    private String sendUserName;

    @ApiModelProperty(value ="上一环节用户id", example="", required=false)
    @TableField("send_user_id")
    private String sendUserId;
    
    @ApiModelProperty(value ="当前处理用户名称", example="", required=false)
    // @NotBlank(message = "当前处理用户名称不能为空: handleUserName")
    @TableField("handle_user_name")
    private String handleUserName;
    
    @ApiModelProperty(value ="当前处理用户Id", example="", required=true)
    @NotBlank(message = "当前处理用户ID不能为空: handleUserId")
    @TableField("handle_user_id")
    private String handleUserId;
    
    @ApiModelProperty(value ="移动端跳转链接", example="", required=false)
    @TableField("app_url")
    private String appUrl;
    
    @ApiModelProperty(value ="PC端跳转链接", example="", required=false)
    @TableField("pc_url")
    private String pcUrl;
    
    @ApiModelProperty(value ="待办状态", example="0：待办，2：已办，3：取消，4：待阅，5：已阅，6：取消阅览", required=false)
    @NotBlank(message = "待办状态不能为空: state")
    @TableField("state")
    private String state;
    
    @ApiModelProperty(value ="待办来源类型", example="PC: 电脑端，APP: 移动端", required=false)
    @TableField("complete_from")
    private String completeFrom;
    
    @ApiModelProperty(value ="活动编码", example="", required=false)
    @TableField("link_code")
    private String linkCode;
    
    @ApiModelProperty(value ="活动名称", example="", required=false)
    @TableField("link_name")
    private String linkName;
    
    @ApiModelProperty(value ="待办类别编码", example="", required=false)
    @TableField("type_code")
    private String typeCode;
    
    @ApiModelProperty(value ="备用1", example="", required=false)
    @TableField("extend1")
    private String extend1;

    @ApiModelProperty(value ="备用2", example="", required=false)
    @TableField("extend2")
    private String extend2;

    @ApiModelProperty(value ="备用3", example="", required=false)
    @TableField("extend3")
    private String extend3;

    @ApiModelProperty(value ="备用4", example="", required=false)
    @TableField("extend4")
    private String extend4;

    @ApiModelProperty(value ="备用5", example="", required=false)
    @TableField("extend5")
    private String extend5;

    @ApiModelProperty(value ="流程实例Id", example="", required=false)
    @TableField("process_inst_id")
    private String processInstId;
    
    @ApiModelProperty(value ="业务主键Id", example="", required=false)
    @TableField("business_id")
    private String businessId;
    
    @ApiModelProperty(value ="业务分类编码", example="", required=false)
    @TableField("biz_code")
    private String bizCode;
    
    @ApiModelProperty(value ="应用Id", example="", required=false)
    @TableField(exist = false)
    private String sysId;
    
    @ApiModelProperty(value ="应用名称", example="", required=false)
    @TableField(exist = false)
    private String sysName;
    
    @ApiModelProperty(value ="类型名称", example="", required=false)
    @TableField(exist = false)
    private String typeName;
    
    @ApiModelProperty(value ="是否内部系统", example="", required=false)
    @TableField(exist = false)
    private String isInternal;
    
    @Override
    protected Serializable pkVal() {
        return this.taskId;
    }

}
